package com.example.zhaojianxu.signin.car.leasecar

import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import com.example.zhaojianxu.signin.R
import com.example.zhaojianxu.signin.car.http.CarEntity

/**
 * create by @zhaojianxu on 2019/3/1
 */
class LeaseCarAdapter: RecyclerView.Adapter<LeaseCarVH>(){

    var mList = mutableListOf<CarEntity>()

    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): LeaseCarVH {
        return LeaseCarVH(LayoutInflater.from(parent?.context).inflate(R.layout.item_lease_car_view,parent,false))
    }

    override fun getItemCount(): Int {
        return mList.size
    }

    override fun onBindViewHolder(holder: LeaseCarVH?, position: Int) {
        holder?.bindData(mList[position])
    }

}